export const copyFn = <T>(value: T): T => {
    /** 空 */
    if (!value) return value;
    /** 数组 */
    if (Array.isArray(value)) return value.map((item) => copyFn(item)) as unknown as T;
    /** 日期 */
    if (value instanceof Date) return new Date(value) as unknown as T;
    /** 普通对象 */
    if (typeof value === 'object') {
        return Object.fromEntries(
            Object.entries(value).map(([k, v]: [string, any]) => {
                return [k, copyFn(v)];
            })
        ) as unknown as T;
    }
    /** 基本类型 */
    return value;
}
